#ifndef _NGX_WRAPPER_HPP_

#include <type_traits>


template<typename T>
class NgxWrapper
{
public:
	using wrapper_type 		= std::remove_pointer<T>::type;
	using point_type 		= wrapper_type*;
	using reference_type 	= wrapper_type&;
private:
	point_type ptr_;
protected:
	NgxWrapper(point_type p) : ptr_(p) {}
	NgxWrapper(reference_type x) : ptr_(&x) {}
	~NgxWrapper() = default;
public:
	point_type get() const
	{
		return ptr_;
	}

	operator point_type() const
	{
		return get();
	}

	point_type operator->() const
	{
		return get();
	}

	operator bool() const
	{
		return get()!=nullptr;
	}
};

#endif // _NGX_WRAPPER_HPP_